package com.example.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 
 * @TableName punishment
 */
@TableName(value ="punishment")
@Data
public class Punishment implements Serializable {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 被处罚用户ID
     */
    private Long userId;

    /**
     * 0:图书罚款, 1:图书借阅功能处罚, 2:座位预约功能处罚, 3:讲座报名功能处罚, 4:入馆处罚
     */
    private Integer punishmentType;

    /**
     * 关联记录ID(如借阅记录ID、预约记录ID等)
     */
    private Long relatedRecordId;

    /**
     * 罚款金额(若有)
     */
    private BigDecimal amount;

    /**
     * 处罚原因
     */
    private String reason;

    /**
     * 处罚开始时间(功能处罚适用)
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    /**
     * 处罚结束时间(功能处罚适用)
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endTime;

    /**
     * 0:处罚中, 1:已结束, 2:已撤销
     */
    private Integer punishmentStatus;

    /**
     * 创建时间
     */
    @TableField(value = "created_at")
    private Date createdAt;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}